Who can use this feature?
Webhooks are a way for apps to automatically send messages or information to each other. They enable different apps to communicate with each other when something new happens. Zapier is an application that uses webhooks to integrate your Mediagraph account with various web apps.
Uploading an asset to Wordpress is one of the many integration processes that can be automated using Webhooks and Zapier. Zapier can be used to upload all assets added to a designated source container in your Mediagraph account to your Wordpress account. Mediagraph has created a Zapier template that can help you to easily set up this workflow. Before you can set up this workflow (or Zap), install the Zapier plugin on your Wordpress account and create a Zapier account.
Install the Zapier plugin for Wordpress
Create a Zapier account
- Follow this link to open the Mediagraph Webhook to WordPress template on Zapier.
- Click Sign up and try this Zap.
- If you already have a Zapier account, log in. If you do not, enter your name and email address, and choose a password for your new account. Click Get Started Free after each prompt. At the end of the signup process, you should be redirected back to the Mediagraph template from earlier. If not, click the link in step one again.
Set up and test a webhook in Mediagraph and Zapier.
- In the Mediagraph Webhook to WordPress template, click to open the Trigger panel at the top of the page.
- In the Test panel, copy the link under Your Webhook URL to your clipboard.
- In another tab or window, open the Manage tab of your Mediagraph account. You will need to keep Mediagraph and Zapier open simultaneously for the rest of the setup process.
- Select Integrations from the sidebar.
- Click Add New in the top right corner of the Webhooks panel.
- Paste the URL copied from the Zapier test panel into the URL field.
- Click Send Test.
- Back in Zapier, click Test Trigger. If the test was successful, you should see “request A” from Mediagraph, with a message reading “Test POST.” If the test was not successful, ensure the URL copied into Mediagraph matches the URL in Zapier.
- Back in Mediagraph, Add a Name and descriptive Note (optional) to your new Webhook.
- Click the slider to switch “Group Assets in payload?” to No.
- Click the slider to switch “Include Full Resolution URL in Payload?” to Yes. If you would rather send only a downsized 1200-px asset to Wordpress, select No.
- Select a source container. This can be a new container, or an existing lightbox, collection, or folder.
Make sure the source container you choose is clearly marked for Wordpress uploads, as all assets added to it will be automatically uploaded after the webhook is enabled.
- At the top of the page, click the enabled/disabled slider to enable your webhook.
- Click Save Webhook.
- Test your webhook by adding an asset to your designated source container.
- Back in Zapier, click Request A.
- In the dropdown, click Load more. You should now see Request B. If you do not, the second test was unsuccessful. Make sure you have selected the correct container when setting up your webhook in Mediagraph.
- Click Request B to select it. Make sure the filename matches the asset you added to the source container.
- If the test was successful, click Continue to open the Action tab, where you can connect your webhook to Wordpress.
Connect your webhook to Wordpress
- In the Action tab, click Sign in to open a pop-up where you can sign in to your Wordpress account.
- After entering your URL, username, and password, click Yes, Continue to WordPress.
- If your sign in was successful, click Continue in Zapier.
- In the Action panel that opens, click the File field.
- In the File field, search for and select Assets Full Url. If you selected a 1200-px asset size in step 11 above, search for and select Assets Permalink Url.
- In the Filename field, search for and select Assets Filename.
- Add any other relevant metadata you want to send to Wordpress. When you are finished, click Continue.
- In the Test panel that opens, click Test Action. If the test was successful, you should see the asset you added to the source container in Mediagraph earlier in your Media Library on Wordpress.
- If the test was successful, click Publish Zap.
- Confirm by clicking Publish & Turn On to begin automating uploads from your Mediagraph account to Wordpress. From now on, whenever you add an asset to the source container you selected when setting up your webhook, it will be uploaded to your Wordpress library.
Pro Tip: You can see log information for all webhooks sent from your Mediagraph account. Go to the Webhooks page in the Manage tab and click Logs next to any webhook. This information can be helpful for advanced troubleshooting.